<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="s" uri="strutsTags"%>
<%@taglib prefix="ty" uri="/wyzzTags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<head>
	<base href="<%=basePath%>">
	<link href="resource/css/style.css" rel="stylesheet" type="text/css" />
	<title>员工管理</title>
	<script type="text/JavaScript" src="resource/js/hrm/profile.js"></script>
	<script type='text/javascript' src='dwr/interface/OrgMapAction.js'></script>
</head>
<body onload="HRMCommon.check_showHide();HRMCommon.check_order();">
	<div id="selectcontent" class="selectdiv"
		style="visibility: hidden; pixelHeight: 20px; z-index: 9;">
		<iframe id="selframe" frameborder="0" height="100%"></iframe>
		<div id="selecthtml" class="selectcontent">
			selectdate
		</div>
	</div>
	<!-- 可输入的select (js引人不要移动位置)-->
	<script type="text/javascript" src="resource/js/edit_select.js"></script>
	<s:component template="bodyhead">
		<s:param name="pagetitle" value="'员工管理'" />
	</s:component>
	<s:form id="searchEmp" name="searchEmp" action="searchEmp"
		namespace="/profile" method="POST">
		<table width="100%" class="formtable">
			<tr>
				<td>
					<s:hidden id="order" name="page.order" />
					<input id="operate" type="hidden" name="page.operate" />
					<s:hidden id="page.currentPage" name="page.currentPage" />
					<div id="basic" style="DISPLAY: block; clear: both">
						<table width="100%">
							<tr>
								<s:textfield id="empNo" label="员工" name="emp.empNoName"
									size="16" maxlength="64" />
								<td align="right">
									组织单元:
								</td>
								<td>
									<s:orgselector id="orgselector1"
										name="emp.empDeptNo.departmentName"
										hiddenFieldName="emp.empDeptNo.id" />
								</td>
								<s:select label="用工形式" name="emp.empType.id" list="empTypes"
									listKey="id" listValue="emptypeName" multiple="false"
									emptyOption="true" value="emp.empType.id" size="1" />
								<s:select label="工作地区" name="emp.empLocationNo.id"
									list="locations" listKey="id" listValue="locationName"
									multiple="false" emptyOption="true"
									value="emp.empLocationNo.id" size="1" />
							</tr>
						</table>
					</div>
					<div id="advanced" style="DISPLAY: none; clear: both">
						<table width="100%">
							<tr>
								<s:textfield label="员工姓名" id="empName" name="emp.empName"
									size="16" maxlength="64" />
								<s:select label="性别" name="emp.empGender" value="emp.empGender"
									list="#{'':'请选择',1:'男', 0:'女'}" />
								<td colspan="2" align="center">
									出生日期:
									<s:textfield id="fromBirthDate" name="emp.empBirthDate"
										size="10" maxlength="10" />
									<img onclick="WdatePicker({el:'fromBirthDate'})"
										class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
									到
									<s:textfield id="tobirthDate" name="emp.birthDate" size="10"
										maxlength="10" />
									<img onclick="WdatePicker({el:'tobirthDate'})" class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
								</td>
							</tr>
							<tr>
								<s:textfield id="empNo" label="员工编号" name="emp.id" size="16"
									maxlength="64" />
								<s:select label="婚否" name="emp.empMarital"
									value="emp.empMarital" list="#{'':'请选择',0:'未婚', 1:'已婚'}" />
								<td colspan="2" align="center">
									工作日期:
									<s:textfield id="fromWorkDate" name="emp.empWorkDate" size="10"
										maxlength="10" />
									<img onclick="WdatePicker({el:'fromWorkDate'})" class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
									到
									<s:textfield id="toWorkDate" name="emp.workDate" size="10"
										maxlength="10" />
									<img onclick="WdatePicker({el:'toWorkDate'})" class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
								</td>
							</tr>
							<tr>
								<s:textfield label="工作电话" name="emp.empWorkPhone" size="16"
									maxlength="32" />
								<s:select label="血型" name="emp.empBlood" value="emp.empBlood"
									list="#{'':'请选择', 'O ':'O ', 'A ':'A ','B ':'B ', 'AB':'AB'}" />
								<td colspan="2" align="center">
									入职日期:
									<s:textfield id="fromDate" name="emp.empJoinDate" size="10"
										maxlength="10" />
									<img onclick="WdatePicker({el:'fromDate'})" class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
									到
									<s:textfield id="toDate" name="emp.joinDate" size="10"
										maxlength="10" />
									<img onclick="WdatePicker({el:'toDate'})" class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif">
								</td>
							</tr>
							<tr>
								<s:textfield label="户口所在地" name="emp.empResidenceLoc"
									maxlength="128" size="16" />
								<td align="right">
									籍贯:
								</td>
								<td>
									<s:component template="editselect" name="emp.empCityNo">
										<s:param name="list"
											value="@com.wyzz.hr.base.ComonBeans@getEmpCityNo()" />
										<s:param name="size" value="8" />
										<s:param name="height" value="220" />
									</s:component>
								</td>
								<td colspan="2" align="center">
									转正日期:
									<s:textfield id="fromConfirmDate" name="emp.empConfirmDate"
										size="10" maxlength="10" />
									<img onclick="WdatePicker({el:'fromConfirmDate'})"
										class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
									到
									<s:textfield id="toConfirmDate" name="emp.confirmDate"
										size="10" maxlength="10" />
									<img onclick="WdatePicker({el:'toConfirmDate'})"
										class="dateimg"
										src="resource/js/My97DatePicker/skin/datePicker.gif" />
								</td>
							</tr>
							<tr>
								<s:textfield label="档案所在地" name="emp.empProfileLoc"
									maxlength="128" size="16" />
								<td align="right">
									民族:
								</td>
								<td>
									<s:component template="editselect" name="emp.empNation">
										<s:param name="list"
											value="@com.wyzz.hr.base.ComonBeans@getEmpNation()" />
										<s:param name="size" value="8" />
										<s:param name="height" value="200" />
									</s:component>
								</td>
								<td align="right">
									组织单元:
								</td>
								<td>
									<s:orgselector id="selector2"
										name="emp.empDeptNo.departmentName"
										hiddenFieldName="emp.empDeptNo.id" />
								</td>
							</tr>
							<tr>
								<s:textfield label="手机" name="emp.empMobile" size="16"
									maxlength="32" />
								<s:textfield label="政治面貌" name="emp.empPolitics" size="14"
									maxlength="30" />
								<s:select label="用工形式" name="emp.empType.id" list="empTypes"
									listKey="id" listValue="emptypeName" multiple="false"
									emptyOption="true" value="emp.empType.id" size="1" />
							</tr>
							<tr>
								<s:textfield label="家庭电话" name="emp.empHomePhone" size="16"
									maxlength="32" />
								<s:textfield label="毕业院校" name="emp.empSchool" size="14"
									maxlength="32" />
								<s:select label="工作地区" name="emp.empLocationNo.id"
									list="locations" listKey="id" listValue="locationName"
									multiple="false" emptyOption="true"
									value="emp.empLocationNo.id" size="1" />
							</tr>
							<tr>
								<s:textfield label="邮箱地址" name="emp.empEmail" size="16"
									maxlength="64" />
								<td align="right">
									专业:
								</td>
								<td>
									<s:component template="editselect" name="emp.empSpeciality">
										<s:param name="list"
											value="@com.wyzz.hr.base.ComonBeans@getEmpSpeciality()" />
										<s:param name="size" value="16" />
										<s:param name="height" value="220" />
									</s:component>
								</td>
								<s:select label="社保种类" id="empBenefitTypeAdv"
									name="emp.empBenefitType.id" list="ebfTypeList" listKey="id"
									listValue="benefitTypeName" multiple="false" headerKey=""
									headerValue="请选择" />
							</tr>
							<tr>
								<s:textfield label="证件号码" name="emp.empIdentificationNo"
									size="16" maxlength="30" />
								<s:select label="学历" name="emp.empDiploma"
									value="emp.empDiploma" emptyOption="true"
									list="@com.wyzz.hr.base.ComonBeans@getEmpDiploma()" />
								<s:if test="@com.wyzz.hr.base.ComonBeans@getShiftEnable()==1">
									<s:select label="考勤方式" name="emp.empShiftType"
										list="#{'':'请选择',0:'免刷卡',2:'默认班次刷卡',3:'按班次刷卡'}"
										emptyOption="false" />
								</s:if>
								<s:else>
									<td colspan="2">
										&nbsp;
									</td>
								</s:else>
							</tr>
							<tr>
								<s:textfield label="当前住址" name="emp.empCurrAddr" size="16"
									maxlength="64" />
								<s:textfield label="即时通讯" name="emp.empMsn" size="14"
									maxlength="64" />
								<s:if test="@com.hr.base.ComonBeans@getShiftEnable()==1">
									<s:textfield label="考勤卡号" name="emp.empShiftNo" size="14" />
								</s:if>
								<s:else>
									<td colspan="2">
										&nbsp;
									</td>
								</s:else>
							</tr>
							<tr>
								<s:textfield label="家庭地址" name="emp.empHomeAddr" size="16"
									maxlength="64" />
								<s:textfield label="紧急联系人" name="emp.empUrgentContact" size="14"
									maxlength="64" />
								<td align="right">
									附加资料:
								</td>
								<td>
									<s:select id="additional" list="additionalList"
										name="additional.eadcSeq" listKey="eadcSeq"
										listValue="eadcFieldName" emptyOption="true"
										onchange="changeAdditional();" />
								</td>
							</tr>
							<tr>
								<s:textfield label="备注" name="emp.empComments" size="16"
									maxlength="128" />
								<s:textfield label="紧急联系方式" name="emp.empUrgentConMethod"
									size="14" maxlength="128" />
								<td>
									&nbsp;
								</td>
								<td align="left">
									<div id="additionalDiv"></div>
								</td>
							</tr>
						</table>
					</div>
				</td>
				<td align="center" nowrap="nowrap">
					<input title="[Alt+F]" accesskey="F" id="submit_button"
						name="button2" class="button" type="submit"
						onclick="HRMCommon.search_check('basic','advanced');" value="查询">
					<input title="[Alt+C]" accesskey="C" name="button22" class="button"
						type="button" onclick="window.location='searchEmp.action';"
						value="重置">
					<br>
					<div id="t1" align="center" style="DISPLAY: block; clear: both">
						<img src="resource/images/basic_search.gif" width="8" height="8">
						<a style="cursor: hand;" class="utilsLink"
							onClick="HRMCommon.searchTypeChange();">高级查询</a>
					</div>
					<div id="t2" align="center" style="DISPLAY: none; clear: both">
						<img src="resource/images/advanced_search.gif" width="8"
							height="8">
						<a style="cursor: hand;" class="utilsLink"
							onClick="HRMCommon.searchTypeChange();">基本查询</a>
					</div>
				</td>
			</tr>
		</table>

		<!-- 操作 -->
		<div class="operatediv">
			<span class="operatedivleft"> <input type="hidden"
					name="searchOrExport" id="searchOrExport" /> <s:hidden
					id="output-ommId" name="outmatchModelId" /> <s:hidden
					id="output-ioName" name="outputIoName" /> <ty:auth auths="101">
					<input class="button" type="button" onclick="batchQuit();"
						value="批量离职" />
					<input class="button" type="button" onclick="doclick();"
						value="批量变动" />
				</ty:auth> <ty:auth auths="101,3 or 101,2">
					<input class="button" type="button" value="数据导入"
						onclick="initDivImmUpload('IEmployeeBasic');" />
					<input class="button" type="button" id="btnOutput" value="数据导出"
						onClick="HRMCommon.search_check('basic','advanced');HRMCommon.export_check('export');" />
				</ty:auth> </span>
			<span class="operatedivright">本次查询共得到<s:property
					value="page.totalRows" />名员工记录</span>
		</div>

		<!-- 查询结果 -->
		<table id="profiletable" cellpadding="0" cellspacing="0" width="100%"
			border="0" class="gridtableList">
			<tr>
				<ty:auth auths="101">
					<th align="center" width="3%">
						<input id="id_check_all" name='emp.ids' class="checkbox"
							type="checkbox"
							onclick="HRMCommon.checkAllByName('emp.ids','id_check_all');"
							value="0">
					</th>
				</ty:auth>
				<th>
					<a onclick="HRMCommon.order_submit('empDistinctNo','searchEmp');">员工编号</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empDistinctNo_img'>
				</th>
				<th>
					<a onclick="HRMCommon.order_submit('empName','searchEmp');">姓名</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empName_img'>
				</th>
				<th>
					<a
						onclick="HRMCommon.order_submit('empOrgDept.departmentSortId','searchEmp');">部门</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empOrgDept.departmentSortId_img'>
				</th>
				<th>
					<a onclick="HRMCommon.order_submit('empPbNo.pbName','searchEmp');">职位</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empPbNo.pbName_img'>
				</th>
				<th>
					<a
						onclick="HRMCommon.order_submit('empLocationNo.locationName','searchEmp');">工作地区</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empLocationNo.locationName_img'>
				</th>
				<th>
					<a
						onclick="HRMCommon.order_submit('empType.emptypeName','searchEmp');">用工形式</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empType.emptypeName_img'>
				</th>
				<th>
					<a onclick="HRMCommon.order_submit('empJoinDate','searchEmp');">司龄</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empJoinDate_img'>
				</th>
				<th>
					<a
						onclick="HRMCommon.order_submit('empLastChangeTime','searchEmp');">最后修改</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='empLastChangeTime_img'>
				</th>
				<th>
					操作
				</th>
			</tr>
			<s:if test="!empList.isEmpty()">
				<s:iterator value="empList" status="index">
					<tr>
						<ty:auth auths="101">
							<td align="center" width="3%">
								<input type="checkbox" name='emp.ids' class="checkbox"
									value="<s:property value='id'/>" />
							</td>
						</ty:auth>
						<td>
							<span
								TITLE="工作电话: <s:property value='empWorkPhone'/>
出生日期: <s:property value='empBirthDate'/>
入职日期: <s:property value='empJoinDate'/>
证件号码: <s:property value='empIdentificationNo'/>
邮箱: <s:property value='empEmail'/>" />
								<a class="listViewTdLinkS1"
								href="profile/myInfo.action?empNo=<s:property value='id'/>&empName=<s:property value='empName'/>"><s:property
										value="empDistinctNo" /> </a>
						</td>
						<td>
							<s:property value="empName" />
						</td>
						<td>
							<s:property value="empDeptNo.departmentName" />
						</td>
						<td>
							<s:property value="empPbNo.pbName" />
						</td>
						<td>
							<s:property value="empLocationNo.locationName" />
						</td>
						<td>
							<s:property value="empType.emptypeName" />
						</td>
						<td align="center">
							<s:property value="getYearOrMonth(joinYear)" />
						</td>
						<td align="center">
							<s:date name="empLastChangeTime" format="yyyy-MM-dd HH:mm" />
						</td>
						<td align="center">
							<img
								onclick="hrm.profile.showInfoCardInfo('<s:property value="id"/>');"
								alt="员工资料卡" title="员工资料卡" border="0" class="urlimg"
								src="resource/images/Search.gif" />
							<ty:auth auths="101">
								<img
									onclick="hrm.profile.deleteEmp('<s:property value="id"/>','searchEmp')"
									alt="删除" title="删除" border="0" class="urlimg"
									src="resource/images/delete.gif" />
							</ty:auth>
						</td>
					</tr>
				</s:iterator>
			</s:if>
			<s:else>
				<tr>
					<td align="center" colspan="13">
						不存在员工信息！
					</td>
				</tr>
			</s:else>
		</table>
		<!-- 分页 -->
		<s:pager end="page.end" pageNo="page.currentPage"
			totalRows="page.totalRows" totalPages="page.totalPages"
			formId="searchEmp" start="page.start" />
		<!-- 　批量修改  -->
		<p>
			&nbsp;
		</p>
		<ty:auth auths="101">
			<s:if test="!empList.isEmpty()">
				<table cellspacing="0" cellpadding="0" border="0" valign="top"
					width="100%">
					<tr>
						<td nowrap="nowrap">
							<!-- 批量修改 -->
							<h3>
								<img src="resource/images/h3Arrow.gif" width="11" height="11"
									border="0">
								批量修改
							</h3>
						</td>
					</tr>
					<tr>
						<td valign="top" width="100%">
							<table width="100%" class="formtable" id="table3">
								<tr>

									<s:textfield label="档案所在地" id="chang_epLoc"
										name="batchemp.empProfileLoc" size="16" maxlength="128" />
									<s:select label="用工形式" id="chang_type" name="batchemp.typeNo"
										list="empTypes" listKey="id" listValue="emptypeName"
										multiple="false" emptyOption="true" value="emp.empType.id"
										size="1" />


									<s:select label="工作地区" id="chang_loc"
										name="batchemp.locationNo" list="locations" listKey="id"
										listValue="locationName" multiple="false" emptyOption="true"
										value="emp.empLocationNo.id" size="1" />
									<s:if test="@com.wyzz.hr.base.ComonBeans@getShiftEnable()==1">
										<s:select label="考勤方式" id="chang_shift_type"
											name="batchemp.empShiftType" emptyOption="false"
											list="#{0:'请选择',1:'免刷卡',2:'默认班次刷卡',3:'按班次刷卡'}" />
									</s:if>
									<td>
										<!-- 修改  -->
										<input title="[Alt+E]" accesskey="E" class="button"
											type="button" onClick="hrm.profile.del_update('update');"
											name="button23" value="批量修改">
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</s:if>
		</ty:auth>
	</s:form>
	<!-- 批量离职 -->
	<div id="dlgQuitDiv" title="批量离职" class="prompt_div_inline"
		style="width: 420;">
		<table width="100%">
			<tr>
				<td>
					离职日期
					<span class="required">*</span>:
				</td>
				<td>
					<s:textfield id="joinDate" name="empquit.eqDate" required="true"
						size="10" maxlength="10" />
					<img onclick="WdatePicker({el:'joinDate'})" class="dateimg"
						src="resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
			</tr>
			<tr>
				<td>
					离职种类
					<span class="required">*</span>:
				</td>
				<td>
					<s:select name="empquit.eqType" id="eqType" list="eqTypeMap"
						onchange="model.simple.changeSubSelect(this,'empquit.eqReason_id','eqTypeSubMap')"></s:select>
				</td>
			</tr>
			<tr>
				<td>
					离职审批人
					<span class="required">*</span>:
				</td>
				<td>
					<s:hidden id="permissionId" name="empquit.eqPermission.id" />
					<s:textfield id="permission" name="permission" size="16"
						readonly="true" />
					<img onclick="showChooseEmpDiv(1,1,'','permission','permissionId')"
						alt="点击图标选择员工" title="点击图标选择员工"
						src="resource/images/search_icon.gif">
				</td>
			</tr>
			<tr>
				<td>
					离职原因
					<span class="required">*</span>:
				</td>
				<td>
					<select id="empquit.eqReason_id" name="empquit.eqReason" />
				</td>
			</tr>
			<tr>
				<td>
					备注:
				</td>
				<td>
					<textarea id="empquit.erComments" name="empquit.erComments"
						rows="8" cols="30"
						onkeyup="if(this.value.length>255){this.value=this.value.substring(0, 255);}"></textarea>
				</td>
			</tr>
			<tr>
				<td colspan="2" class="prompt_div_bottom">
					<input type="hidden" name="qemp.ids" id="ids" />
					<input name="eqAddbtn" id="eqAddbtn" class="button" type="button"
						onclick="batchQuitSubmit();" value="离职" />
					<input name="eqClosebtn" id="eqClosebtn" class="button"
						type="button" value="关闭"
						onclick="HRMCommon.closeDialog('dlgQuitDiv');" />
				</td>
			</tr>
		</table>
	</div>
	<!-- 批量变动 -->
	<div id="dlgTransfer" title="变动记录" class="prompt_div_inline"
		style="width: 420;">
		<table width="100%">
			<tr id="targetTr">
				<td align="left">
					变动种类
					<span class="required">*</span>:
				</td>
				<td>
					<select name="transfer.eftTransferType" id="transferType"
						onchange="changeForm()">
						<option value="0">
							平调
						</option>
						<option value="1">
							晋升
						</option>
						<option value="2">
							降级
						</option>
						<option value="3">
							转岗
						</option>
						<option value="4">
							转正
						</option>
					</select>
				</td>
			</tr>
			<tr>
				<td align="left">
					变动时间
					<span class="required">*</span>:
				</td>
				<td>
					<s:textfield name="transfer.eftTransferDate" id="transferTime"
						required="true" size="10" maxlength="10" />
					<img onclick="WdatePicker({el:'transferTime'})" class="dateimg"
						src="resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
			</tr>
			<tr>
				<td align="left" id="tdDeptAndPb">
					新组织单元
					<span class="required">*</span>:
				</td>
				<td>
					<div>
						<s:hidden id="chang_deptId" name="transfer.eftNewDeptNo.id" />
						<s:hidden id="chang_dept" name="chang_dept" />
						<s:hidden id="positionId" name="newPosition.id" />
						<s:hidden id="changePosition" name="changePosition" />
						<input type="text" id="chang_dept-changePosition"
							class="selecttext" readonly="readonly" size="26" />
						<img
							onclick="showPostionTree('changePosition', 'positionId','chang_dept','chang_deptId');"
							id="showdiv" class="selectimg"
							src="resource/images/select_button.BMP">
					</div>
				</td>
			</tr>
			<tr>
				<td align="left">
					变动原因:
				</td>
				<td colspan="3">
					<input name="transfer.eftReason" size="28" maxlength="128" />
				</td>
			</tr>
			<tr>
				<td align="left">
					备注:
				</td>
				<td>
					<textarea name="transfer.eftComments" rows="8" cols="30"
						onkeyup="if(this.value.length>255){this.value=this.value.substring(0, 255);}"></textarea>
				</td>
			</tr>
			<tr>
				<input type="hidden" name="ids" id="transids" />
				<input type="hidden" name="transfer.eftNewDeptNo" id="eftNewDeptNo" />
				<input type="hidden" name="transfer.eftNewJobTitle"
					id="eftNewJobTitle" />
				<td colspan="2" class="prompt_div_bottom">
					<input id="trAddbtn" class="button" type="button" value="确定"
						onclick="hrm.profile.del_update('dlgTransfer');" />
					<input id="trCancelbtn" class="button" type="button" value="取消"
						onclick="HRMCommon.closeDialog('dlgTransfer')" />
				</td>
			</tr>
		</table>
	</div>

	<span id="dateSpan" style="display: none"> <s:textfield
			id="dateValue" name="additional.value" size="10" maxlength="10" /> <img
			onclick="WdatePicker({el:'dateValue'})" class="dateimg"
			src="resource/js/My97DatePicker/skin/datePicker.gif"> 到<s:textfield
			id="dateValue2" name="additional.value2" size="10" maxlength="10" />
		<img onclick="WdatePicker({el:'dateValue2'})" class="dateimg"
			src="resource/js/My97DatePicker/skin/datePicker.gif"> </span>

	<div style="display: none">
		<table>
			<tr>
				<td id="srcTd">
					<s:select id="employmentForm" name="transfer.eftNewEmpType.id"
						list="empTypes" listKey="id" listValue="emptypeName"
						multiple="false" value="emp.empType.id" size="1" />
				</td>
			</tr>
		</table>
	</div>
	<script type="text/javascript">
function changeForm(){
  var value = $('#transferType').val();
  if(value==4){
    $('#tdDeptAndPb').html("&nbsp;新组织单元:");
    
    var typeSelect=$('#employmentForm');
    
    var target=$('#targetTr');
    var tr=$('<tr></tr>');
    tr.attr("id","employmentFormTr");
    var td=$('<td></td>');
	td.html("&nbsp用工形式<span class=\"required\">*</span>:");
	tr.append(td);
	var empFormTd=$('<td></td>');
	empFormTd.append(typeSelect);
	tr.append(empFormTd);
	
	target.after(tr);
  }else{
	  $('#tdDeptAndPb').html("&nbsp;新组织单元<span class=\"required\">*</span>:");
    var srcSelect=$('#employmentForm');
    var scrTd=$('#srcTd');
    scrTd.append(srcSelect);
    $('#employmentFormTr').remove();
  }
}

//批量离职的检查
function batchQuit(){
	var checkBoxs=document.getElementsByName('emp.ids');
	var flag=0;
	var error="";
	var ids = "";
	for(var i=1;i<checkBoxs.length;i++){
		if(checkBoxs[i].checked&&checkBoxs[i].checked==true){
			flag=1;
			ids+= checkBoxs[i].value;
			if(i != checkBoxs.length - 1){
				ids+= ",";
			}
		}
	}
	if(flag==0){
		error="请至少选择一个员工！";
		alert(error);
		return ;
	}
	else{
		alert("请确认该员工的离职手续已办理完毕！");
		ids = ids.trim();
		if(',' == ids.charAt(ids.length-1)){
			ids = ids.substring(0,ids.length-1);
		}
		document.getElementById('ids').value = ids;
		//初始化批量离职日期
		document.getElementById('joinDate').value=(new Date()).toHRMDateString();
		HRMCommon.openDialog('dlgQuitDiv','searchEmp');
	}
}
//批量离职的提交
function batchQuitSubmit(){
	if(!HRMCommon.isDate(document.getElementById('joinDate').value)) {
		alert('复职日期不能为空或日期格式不正确！');
		return;
	}
	if(HRMCommon.isNull(document.getElementById('empquit.eqReason_id').value)){
		alert("离职原因不能为空！");
		return;
	}
	if(HRMCommon.isNull(document.getElementById('permissionId').value)){
		alert("离职审批人不能为空！");
		return;
	}
	HRMCommon.search_check('basic','advanced');
	$('#empName').val("");
	document.getElementById('searchEmp').action="profile/batchQuit.action";
	document.getElementById('searchEmp').submit();
}
//批量变动
var selectedNum;
var selectedIds;
function doclick(){
    selectedNum=0;
    selectedIds='';
    document.getElementById('changePosition').value='';
    document.getElementById('chang_dept-changePosition').value='';
    $('#positionId').val('');
    $('#chang_deptId').val('');
	$('#chang_dept').val('');	
	var checkBoxs=document.getElementsByName('emp.ids');
	var flag=0;
	var error="";
	for(var i=1;i<checkBoxs.length;i++){
		if(checkBoxs[i].checked&&checkBoxs[i].checked==true){
		flag=1;
		selectedNum=selectedNum+1;
		selectedIds+= checkBoxs[i].value;
		selectedIds+=',';
		}
	}
	selectedIds = selectedIds.trim();
    if(selectedIds.charAt(selectedIds.length-1)==','){
       selectedIds = selectedIds.substring(0,selectedIds.length-1);
    }
	if(flag==0){
		error="请至少选择一个员工！";
 		alert(error);
		return ;
 	 }
	else{
		//初始化批量变动日期
		document.getElementById('transferTime').value=(new Date()).toHRMDateString();
		HRMCommon.openDialog('dlgTransfer','searchEmp');
	}
}
//初始化附加资料的自定义字段对象数组
function initAdditionalList(){
	var addArr=new Array();
	<s:iterator value="additionalList" status="rowstatus">
		var obj = new Object();
		obj.type="<s:property value='eadcFieldType'/>";
		obj.value="<s:property value='eadcFieldValue'/>";
		addArr[<s:property value="eadcSeq"/>] = obj;
	</s:iterator>
	return addArr;
}
var fieldIndex=document.getElementById('additional').value;//保存上一次查询时所选择附加资料选项的index
//根据所选择的附加资料选项显示对应类型的输入框
function changeAdditional(){
	var value = "<s:property value='additional.value'/>";
	var value2 = "<s:property value='additional.value2'/>";
	document.getElementById('additionalDiv').innerHTML = "";
	var index = document.getElementById('additional').value;
	if(fieldIndex!=index){
		value="";
		value2="";
	}
	if(index ==0)return;
	var obj = ADDITIONAL_ARRAY[index];
	switch(obj.type){
	case 'select':
		var arr = obj.value.split(',');
		var html = "<select name='additional.value'>";
		for(var i =0; i < arr.length; i++){
			var tmp = "";
			if(arr[i].value == value){
				tmp= "selected";
			}
			html += "<option value='"+arr[i]+"' "+tmp+">"+arr[i]+"</option>";
		}
		html +="</select><input type='hidden' name='additional.eadcFieldType' value='select'/>";
		document.getElementById('additionalDiv').innerHTML =html;
		break;
	case 'input':
	case 'textarea':
		var html = "<input size=14 value='"+value+"' name='additional.value'/><input type='hidden' name='additional.eadcFieldType' value='input'/>";
		document.getElementById('additionalDiv').innerHTML =html;
		break;
	case 'date':
		var html = document.getElementById('dateSpan').innerHTML;
		html +="<input type='hidden' name='additional.eadcFieldType' value='date'/>";
		document.getElementById('additionalDiv').innerHTML =html;
		document.getElementById('dateValue').value=value;
		document.getElementById('dateValue2').value=value2;
		break;
	case 'number':
		var html = "<input size=14 value='"+value+"' name='additional.value' onkeypress='HRMCommon.checkOnKeyDownFloat(event,this);'/>到<input size=14 value='"+value2+"' name='additional.value2' onkeyup='HRMCommon.checkOnKeyUpFloat(event,this);'/><input type='hidden' name='additional.eadcFieldType' value='number'/>";
		document.getElementById('additionalDiv').innerHTML =html;
		break;
	}
}
HRMCommon.initDialog('dlgQuitDiv',350);//批量离职dialog初始化
HRMCommon.initDialog('dlgTransfer',350);//批量变动dialog初始化

var ADDITIONAL_ARRAY = initAdditionalList();//初始化附加资料下拉框
changeAdditional();//保存上次所选的附加资料类型

//初始化离职下拉框
var eqTypeSubMap={};//二级下拉框Map
<s:iterator value="eqReasonMap" id="topEntrySet">
	eqTypeSubMap['<s:property value="#topEntrySet.key"/>']={};
	<s:iterator value="#topEntrySet.value" status="index" id="secEntrySet">
		<s:if test="#secEntrySet.key.length()==0">
			eqTypeSubMap['<s:property value="#topEntrySet.key"/>']['']='<s:property value="#secEntrySet.value"/>';
		</s:if><s:else>
			eqTypeSubMap['<s:property value="#topEntrySet.key"/>']['<s:property value="#secEntrySet.value"/>']='<s:property value="#secEntrySet.value"/>';
		</s:else>
	</s:iterator>
</s:iterator>
model.simple.changeSubSelect('eqType','empquit.eqReason_id','eqTypeSubMap','<s:property value="empquit.eqReason"/>');
</script>

	<%@ include file="search_emp_div.jsp"%>
	<jsp:include flush="true" page="position_choose_div.jsp"></jsp:include>
	<jsp:include flush="true" page="../io/div_omm_select.jsp"></jsp:include>
	<jsp:include flush="true" page="../io/div_upload.jsp"></jsp:include>
</body>